package com.spring.housing.controller.login;


import com.spring.housing.acceptType.PageParams;
import com.spring.housing.returnType.CommenResult;
import com.spring.housing.service.loginService.LonginServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

/**
 * @Author lzm
 * @Description
 * @Date 2021-12-14 19:18
 **/
@Slf4j
@RestController
@RefreshScope //支持Nacos的动态刷新功能。
public class LoginController
{
    @Autowired
   LonginServer longinServer;

 //
    @PostMapping("/login/index")
    public CommenResult getinfo(@RequestBody PageParams params){

        return longinServer.getinfo(params);
    }
    //注册
    @PostMapping("register/index")
    public CommenResult<String> register(@RequestBody PageParams params) {
        return   longinServer.register(params);
    }
        @PostMapping("/test")
    public String test (){
        return longinServer.logintest ();
    }
}
